﻿using System;

namespace Agile.DataAccess
{
    /// <summary>
    /// 
    /// </summary>
    internal partial class DbContext
	{
        /// <summary>
        /// 
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
		public IDbContext OnConnectionOpening(Action<ConnectionEventArgs> action)
		{
			Data.OnConnectionOpening = action;
			return this;
		}
        /// <summary>
        /// 
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        public IDbContext OnConnectionOpened(Action<ConnectionEventArgs> action)
		{
			Data.OnConnectionOpened = action;
			return this;
		}
        /// <summary>
        /// 
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
		public IDbContext OnConnectionClosed(Action<ConnectionEventArgs> action)
		{
			Data.OnConnectionClosed = action;
			return this;
		}
        /// <summary>
        /// 
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
		public IDbContext OnExecuting(Action<CommandEventArgs> action)
		{
			Data.OnExecuting = action;
			return this;
		}
        /// <summary>
        /// 
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
		public IDbContext OnExecuted(Action<CommandEventArgs> action)
		{
			Data.OnExecuted = action;
			return this;
		}
        /// <summary>
        /// 
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
		public IDbContext OnError(Action<ErrorEventArgs> action)
		{
			Data.OnError = action;
			return this;
		}
	}
}
